<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>

<jsp:include page="global-actions.jsp"/>

<%-- Enum constants--%>
<c:set var="EMainMenuItemName_HOME" value="HOME" />
<c:set var="EMainMenuItemName_CREATE" value="CREATE" />
<c:set var="EMainMenuItemName_MODIFY" value="MODIFY" />

<%-- Some values --%>
<c:set var="selectedItemClass" value="sel" />
<c:set var="firstItemClass" value="first" />
<c:set var="selectedMainMenuItemName"
	value="${not empty overrideMainMenuItemName ? overrideMainMenuItemName : mainMenuItemName}" />

<%-- The menu --%>
<ul id="main-menu-admin">

	<%-- Whether a menu item has already been added to the menu --%>
	<c:set var="isFirstLiSet" value="${false}" />

	<%-- The menu item for the admin section --%>
	<sec:authorize access="hasRole('ROLE_ADMIN')">
		<li	class="${not isFirstLiSet ? firstItemClass : ''}
      		${selectedMainMenuItemName == EMainMenuItemName_HOME ? selectedItemClass : ''}">
		<a href='<c:url value="/admin/home.do"/>'> <spring:theme
			code='tab.name.home' /> </a></li>
		<c:set var="isFirstLiSet" value="${true}" />

		<li	class="${not isFirstLiSet ? firstItemClass : ''}
      		${selectedMainMenuItemName == EMainMenuItemName_CREATE ? selectedItemClass : ''}">
		<a href='<c:url value="/admin/product/create.do"/>'> <spring:theme
			code='tab.name.create' /> </a></li>
		<c:set var="isFirstLiSet" value="${true}" />

		<li	class="${not isFirstLiSet ? firstItemClass : ''}
      		${selectedMainMenuItemName == EMainMenuItemName_MODIFY ? selectedItemClass : ''}">
		<a href='<c:url value="/admin/product/modify.do"/>'> <spring:theme
			code='tab.name.modify' /> </a></li>
		<c:set var="isFirstLiSet" value="${true}" />
	</sec:authorize>


</ul>
